![]() |
GetPalette |
||||
Header: | Palettes.h | Carbon status: | Supported | |
Obtains a window’s palette.
PaletteHandle GetPalette ( WindowRef srcWindow );
A pointer to the window for which you want the associated palette.
A handle to the palette associated with the window specified in the srcWindow parameter or NULL if the window has no associated palette or is not a color window.
Normally, the GetPalette function does not allocate memory, with one exception. When your application calls GetPalette to get a copy of the default application palette, the Palette Manager looks at the AppPalette global variable. If AppPalette is NULL, GetPalette makes a copy of the default system palette and returns a handle to this copy.
You request the default palette as follows:
myPaletteHndl = GetPalette ((WindowPtr) -1);
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)